#include <iostream>
#include <vector>

using namespace std;
//使用向量。

bool contain(vector<int> A,int i); 

void UniSet(vector<int> A, vector<int> B) {
	vector<int>::iterator it;
	for(it=B.begin();it!=B.end();it++){
		int i = *it;
		if (!contain(A,i)){
			A.insert(A.begin(),i);
		}
	}
	vector<int>::iterator res;
	for(res=A.begin();res!=A.end();res++)
	   cout << *res << " ";
		
}

bool contain(vector<int> A,int i){
	vector<int>::iterator it;
	for(it=A.begin();it!=A.end();it++){
		if (*it==i){
			return true;
		}
	}
	return false;
}

int main() {
	//新增向量A 
    vector<int> A;
    int iA[] = {1,2,3,4,5,6,7,8,9,10};
    for (int i = 0 ; i < 10 ; i++)
    A.push_back(iA[i]);
	
	//新增向量B 
    vector<int> B;
    int iB[] = {2,0,5,6};
    for (int i = 0 ; i < 4 ; i++)
    B.push_back(iB[i]);
    
	//进行并集 
	UniSet(A, B);
    return 0;
}
